const { defineConfig } = require('@vue/cli-service')
module.exports = {
    publicPath: './',
    assetsDir: 'static',
    productionSourceMap: true,
    devServer: {
        port: 8092,
        proxy: {
            '/dev-api':{
                //target:'http://47.110.11.57:8124',
                target:'http://192.168.1.101:8124',
                    changeOrigin:true,
                    pathRewrite:{
                    '/dev-api':''
                }
            }
        }
    },
	 configureWebpack: {
	     resolve: {
	       alias: {
	         'cornerstone-core': 'cornerstone-core/dist/cornerstone.js',
	         'cornerstone-tools': 'cornerstone-tools/dist/cornerstoneTools.js'
	       }
	     }
	   },
	   
	   chainWebpack: config => {
	     // 添加对 worker 文件的支持
	     config.module
	       .rule('worker')
	       .test(/\.worker\.js$/)
	       .use('worker-loader')
	       .loader('worker-loader')
	       .options({
	         inline: 'fallback'
	       })
	     
	     // 确保正确解析 cornerstone 相关模块
	     config.resolve.alias
	       .set('cornerstone-core', 'cornerstone-core/dist/cornerstone.js')
	       .set('cornerstone-tools', 'cornerstone-tools/dist/cornerstoneTools.js')
	   }
}